#DEBUG = -DDEBUG -DDEBUGSCREEN
DEBUG = -DDEBUG

#CFLAGS = -Wall ${DEBUG} -DUSE_NETWORK
CFLAGS = -Wall ${DEBUG} 

CC = gcc ${CFLAGS}
CPP = g++ ${CFLAGS}

INCDIR  = -I../../../common
INCDIR += -I../../lib

GOTEMP_OBJS = gotemp_standalone.o

GPS_OBJS = gps_standalone.o 
GPS_OBJS += delay.o 
GPS_OBJS += logfile.o

default: compass

all: compass gps

clean :
	rm -f *.o *.exe *.a *.stackdump compass gps sd84

distclean: clean
	rm -f *.log command*.txt telemetry*.txt 
			
unused :
	rm -f *.o

sd84 : sd84_standalone.o delay.o logfile.o cssl.o
	${CPP} -o sd84 sd84_standalone.o delay.o logfile.o cssl.o

compass : compass_standalone.o delay.o logfile.o cssl.o
	${CPP} -o compass compass_standalone.o delay.o logfile.o cssl.o

gps : ${GPS_OBJS}  
	${CPP} -o gps ${GPS_OBJS}

gotemp: ${GOTEMP_OBJS}
	${CPP} -o gotemp ${GOTEMP_OBJS}

# object files from this directory

%.o : %.c 
	${CC} -c ${INCDIR} $<		
	

# object files from comon directory
	
%.o: ../../../common/%.c 
	${CC} -c ${INCDIR} $<


# object files from lib directory	

%.o : ../../lib/%.c 
	${CC} -c ${INCDIR} $<		


